-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import generic functions from extracted Go code as interpreted code #1647
Open
rcoreilly
wants to merge
17
commits into
traefik:master
Choose a base branch
from
cogentcore:generic-func
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…new x/packages. also found minimal set of Need flags.
… conversion nil guard
This and all the other PRs from me should now be good in terms of passing tests and working in our "real world" codebase which uses a lot of generics. |
…ic_test.go with additional test cases. hopefully that's the end of it..
Excuse me, will this feature be merged into the main branch? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes issues like #1457 #1601 by importing the source code for generic functions in extracted Go code, so that it can be interpreted in yaegi.
You need to add a
//yaegi:add
comment directive to functions to so import, as importing all generic functions might not be desirable or feasible. In particular, given the need to interpret the generic code, it can not access any non-exported functions, types, or fields.The extracted code is wrapped in a
GenericFunc
string type value as below:This PR builds on #1642 which interacts with this code in extracting the function source.